<template>
  <div>
    <h1>Home</h1>
    <ul>
      <li v-for="article in articles" :key="article.slug">
        {{ article.title }}
      </li>
    </ul>
  </div>
</template>

<script>
import { mapState, mapActions } from "vuex";
export default {
  metaInfo: {
    title: "Home",
  },
  computed: {
    ...mapState(["articles"]),
  },
  methods: {
    ...mapActions(["fetchArticles"]),
  },
  serverPrefetch() {
     return this.fetchArticles()
  },
  // asyncData({store}){
  //      return store.dispatch('fetchArticles')

  // }
};
</script>

<style>
</style>